package com.mzz.behavior.state.memento;

/**
 * 用户信息
 *
 * @author xushijian
 * @date 18/5/16
 */
public class UserInfo {

    private String account;

    private String password;

    private String telNo;

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getTelNo() {
        return telNo;
    }

    public void setTelNo(String telNo) {
        this.telNo = telNo;
    }

    public Memento saveMemento() {
        return new Memento(account, password, telNo);
    }

    public void restoreMemento(Memento memento) {
        this.account = memento.getAccount();
        this.password = memento.getPassword();
        this.telNo = memento.getTelNo();
    }

    public void show() {
        System.out.println("UserInfo{" +
                "account='" + account + '\'' +
                ", password='" + password + '\'' +
                ", telNo='" + telNo + '\'' +
                '}');
    }
}
